- 1 - A. Appendix_for_as8096_Frankenstein_Assembler A.1 Pseudo_Operations A.1.1 Standard_Pseudo_Operation_Mnemonics End END File Inclusion INCL INCLUDE If IF Else ELSE End If ENDI Equate EQU Set SET Org ORG Reserve Memory DSB RESERVE RMB Define Byte Data BYTE DCB FCB Define String Data FCC STRING Define Character Set Translation CHARSET Define Character Value CHARDEF CHD Use Character Translation CHARUSE A.1.2 Machine_Dependent_Pseudo_Operations A.1.2.1 Define_Word_Data,_Aligned [Label] WORD expression [, expression] ... [Label] FDB expression [, expression] ... [Label] DCW expression [, expression] ... The define word statement generates a two byte integer for each expression in the expression list. There can be up to 128 expressions on a line, more than the line length will allow. The location counter is adjusted by skipping bytes to make the first location address divisible by 2. The generated constants are in byte reversed order, with the low order byte first, followed by the high order byte. The optional label is set to the first location of this area. A.1.2.2 Define_Long_Word_Data,_Aligned [Label] LONG expression [, expression] ... [Label] DCL expression [, expression] ... The define long word statement generates a four byte integer for each expression in the expression list. There can be up to 128 expressions on a line, more than the line length will allow. The location counter is adjusted by skipping bytes to make the first location address divisible by 4. The generated constants are in byte reversed order, with the low order byte first, followed by the high order bytes. The optional label is set to the first location of this area. - 2 - A.1.2.3 Reserve_Memory,_Word_Aligned [Label] DSW expression This statement moves the location counter forward by the number of bytes specified in the expression. The location counter is adjusted by skipping bytes to make the first location address divisible by 2. The label is set to the first location of this area. A.1.2.4 Reserve_Memory,_Long_Word_Aligned [Label] DSL expression This statement moves the location counter forward by the number of long words specified in the expression. The location counter is adjusted by skipping bytes to make the first location address divisible by 4. The label is set to the first location of this area. A.1.2.5 Instruction_Set_Selection CPU string The instruction set can be specified in the source file with the CPU pseudooperation. The string, delimited by quotes or apostrophes, is scanned for a substring which selects which instruction set is used. When the program is invoked, this operation is performed on the name of the program, then the -p optional arguement, if any, and then any CPU statements. The last one selects which subset of the instructions the assembler will accept. The instruction set can be changed at any place in the source file. Instruction Set Substrings 80c196 19 8096 9 A.2 Instructions A.2.1 Instruction_List Opcode Syntax Selection Criteria ADD expr ',' '#' expr ADD expr ',' '[' expr ']' ADD expr ',' expr ',' '#' expr ADD expr ',' expr ',' '[' expr ']' - 3 - Opcode Syntax Selection Criteria ADD expr ',' expr ',' expr '[' expr ']' DIRECT ADD expr ',' expr ',' expr '[' expr ']' EXTENDED ADD expr ',' expr ',' expr DIRECT ADD expr ',' expr ',' expr EXTENDED ADD expr ',' expr '[' expr ']' DIRECT ADD expr ',' expr '[' expr ']' EXTENDED ADD expr ',' expr DIRECT ADD expr ',' expr EXTENDED ADDB expr ',' '#' expr ADDB expr ',' '[' expr ']' ADDB expr ',' expr ',' '#' expr ADDB expr ',' expr ',' '[' expr ']' ADDB expr ',' expr ',' expr '[' expr ']' DIRECT ADDB expr ',' expr ',' expr '[' expr ']' EXTENDED ADDB expr ',' expr ',' expr DIRECT ADDB expr ',' expr ',' expr EXTENDED ADDB expr ',' expr '[' expr ']' DIRECT ADDB expr ',' expr '[' expr ']' EXTENDED ADDB expr ',' expr DIRECT ADDB expr ',' expr EXTENDED ADDC expr ',' '#' expr ADDC expr ',' '[' expr ']' ADDC expr ',' expr '[' expr ']' DIRECT ADDC expr ',' expr '[' expr ']' EXTENDED ADDC expr ',' expr DIRECT ADDC expr ',' expr EXTENDED ADDCB expr ',' '#' expr ADDCB expr ',' '[' expr ']' ADDCB expr ',' expr '[' expr ']' DIRECT ADDCB expr ',' expr '[' expr ']' EXTENDED ADDCB expr ',' expr DIRECT ADDCB expr ',' expr EXTENDED AND expr ',' '#' expr AND expr ',' '[' expr ']' AND expr ',' expr ',' '#' expr AND expr ',' expr ',' '[' expr ']' AND expr ',' expr ',' expr '[' expr ']' DIRECT AND expr ',' expr ',' expr '[' expr ']' EXTENDED AND expr ',' expr ',' expr DIRECT AND expr ',' expr ',' expr EXTENDED AND expr ',' expr '[' expr ']' DIRECT AND expr ',' expr '[' expr ']' EXTENDED AND expr ',' expr DIRECT - 4 - Opcode Syntax Selection Criteria AND expr ',' expr EXTENDED ANDB expr ',' '#' expr ANDB expr ',' '[' expr ']' ANDB expr ',' expr ',' '#' expr ANDB expr ',' expr ',' '[' expr ']' ANDB expr ',' expr ',' expr '[' expr ']' DIRECT ANDB expr ',' expr ',' expr '[' expr ']' EXTENDED ANDB expr ',' expr ',' expr DIRECT ANDB expr ',' expr ',' expr EXTENDED ANDB expr ',' expr '[' expr ']' DIRECT ANDB expr ',' expr '[' expr ']' EXTENDED ANDB expr ',' expr DIRECT ANDB expr ',' expr EXTENDED BMOV expr ',' expr CPU196 BR '[' expr ']' CLR expr CLRB expr CLRC CLRVT CMP expr ',' '#' expr CMP expr ',' '[' expr ']' CMP expr ',' expr '[' expr ']' DIRECT CMP expr ',' expr '[' expr ']' EXTENDED CMP expr ',' expr DIRECT CMP expr ',' expr EXTENDED CMPB expr ',' '#' expr CMPB expr ',' '[' expr ']' CMPB expr ',' expr '[' expr ']' DIRECT CMPB expr ',' expr '[' expr ']' EXTENDED CMPB expr ',' expr DIRECT CMPB expr ',' expr EXTENDED CMPL expr ',' expr CPU196 DEC expr DECB expr - 5 - Opcode Syntax Selection Criteria DI DIV expr ',' '#' expr DIV expr ',' '[' expr ']' DIV expr ',' expr '[' expr ']' DIRECT DIV expr ',' expr '[' expr ']' EXTENDED DIV expr ',' expr DIRECT DIV expr ',' expr EXTENDED DIVB expr ',' '#' expr DIVB expr ',' '[' expr ']' DIVB expr ',' expr '[' expr ']' DIRECT DIVB expr ',' expr '[' expr ']' EXTENDED DIVB expr ',' expr DIRECT DIVB expr ',' expr EXTENDED DIVU expr ',' '#' expr DIVU expr ',' '[' expr ']' DIVU expr ',' expr '[' expr ']' DIRECT DIVU expr ',' expr '[' expr ']' EXTENDED DIVU expr ',' expr DIRECT DIVU expr ',' expr EXTENDED DIVUB expr ',' '#' expr DIVUB expr ',' '[' expr ']' DIVUB expr ',' expr '[' expr ']' DIRECT DIVUB expr ',' expr '[' expr ']' EXTENDED DIVUB expr ',' expr DIRECT DIVUB expr ',' expr EXTENDED DJNZ expr ',' expr DJNZW expr ',' expr CPU196 EI EXT expr EXTB expr IDLPD '#' expr CPU196 INC expr INCB expr JBC expr ',' expr ',' expr - 6 - Opcode Syntax Selection Criteria JBS expr ',' expr ',' expr JC expr JE expr JGE expr JGT expr JH expr JLE expr JLT expr JNC expr JNE expr JNH expr JNST expr JNV expr JNVT expr JST expr JV expr JVT expr LCALL expr LD expr ',' '#' expr LD expr ',' '[' expr ']' LD expr ',' expr '[' expr ']' DIRECT LD expr ',' expr '[' expr ']' EXTENDED LD expr ',' expr DIRECT LD expr ',' expr EXTENDED LDB expr ',' '#' expr LDB expr ',' '[' expr ']' LDB expr ',' expr '[' expr ']' DIRECT - 7 - Opcode Syntax Selection Criteria LDB expr ',' expr '[' expr ']' EXTENDED LDB expr ',' expr DIRECT LDB expr ',' expr EXTENDED LDBSE expr ',' '#' expr LDBSE expr ',' '[' expr ']' LDBSE expr ',' expr '[' expr ']' DIRECT LDBSE expr ',' expr '[' expr ']' EXTENDED LDBSE expr ',' expr DIRECT LDBSE expr ',' expr EXTENDED LDBZE expr ',' '#' expr LDBZE expr ',' '[' expr ']' LDBZE expr ',' expr '[' expr ']' DIRECT LDBZE expr ',' expr '[' expr ']' EXTENDED LDBZE expr ',' expr DIRECT LDBZE expr ',' expr EXTENDED LJMP expr MUL expr ',' '#' expr MUL expr ',' '[' expr ']' MUL expr ',' expr ',' '#' expr MUL expr ',' expr ',' '[' expr ']' MUL expr ',' expr ',' expr '[' expr ']' DIRECT MUL expr ',' expr ',' expr '[' expr ']' EXTENDED MUL expr ',' expr ',' expr DIRECT MUL expr ',' expr ',' expr EXTENDED MUL expr ',' expr '[' expr ']' DIRECT MUL expr ',' expr '[' expr ']' EXTENDED MUL expr ',' expr DIRECT MUL expr ',' expr EXTENDED MULB expr ',' '#' expr MULB expr ',' '[' expr ']' MULB expr ',' expr ',' '#' expr MULB expr ',' expr ',' '[' expr ']' MULB expr ',' expr ',' expr '[' expr ']' DIRECT MULB expr ',' expr ',' expr '[' expr ']' EXTENDED MULB expr ',' expr ',' expr DIRECT MULB expr ',' expr ',' expr EXTENDED MULB expr ',' expr '[' expr ']' DIRECT MULB expr ',' expr '[' expr ']' EXTENDED MULB expr ',' expr DIRECT MULB expr ',' expr EXTENDED MULU expr ',' '#' expr - 8 - Opcode Syntax Selection Criteria MULU expr ',' '[' expr ']' MULU expr ',' expr ',' '#' expr MULU expr ',' expr ',' '[' expr ']' MULU expr ',' expr ',' expr '[' expr ']' DIRECT MULU expr ',' expr ',' expr '[' expr ']' EXTENDED MULU expr ',' expr ',' expr DIRECT MULU expr ',' expr ',' expr EXTENDED MULU expr ',' expr '[' expr ']' DIRECT MULU expr ',' expr '[' expr ']' EXTENDED MULU expr ',' expr DIRECT MULU expr ',' expr EXTENDED MULUB expr ',' '#' expr MULUB expr ',' '[' expr ']' MULUB expr ',' expr ',' '#' expr MULUB expr ',' expr ',' '[' expr ']' MULUB expr ',' expr ',' expr '[' expr ']' DIRECT MULUB expr ',' expr ',' expr '[' expr ']' EXTENDED MULUB expr ',' expr ',' expr DIRECT MULUB expr ',' expr ',' expr EXTENDED MULUB expr ',' expr '[' expr ']' DIRECT MULUB expr ',' expr '[' expr ']' EXTENDED MULUB expr ',' expr DIRECT MULUB expr ',' expr EXTENDED NEG expr NEGB expr NOP NORML expr ',' expr NOT expr NOTB expr OR expr ',' '#' expr OR expr ',' '[' expr ']' OR expr ',' expr '[' expr ']' DIRECT OR expr ',' expr '[' expr ']' EXTENDED OR expr ',' expr DIRECT OR expr ',' expr EXTENDED ORB expr ',' '#' expr ORB expr ',' '[' expr ']' ORB expr ',' expr '[' expr ']' DIRECT - 9 - Opcode Syntax Selection Criteria ORB expr ',' expr '[' expr ']' EXTENDED ORB expr ',' expr DIRECT ORB expr ',' expr EXTENDED POP '[' expr ']' POP expr '[' expr ']' DIRECT POP expr '[' expr ']' EXTENDED POP expr DIRECT POP expr EXTENDED POPA CPU196 POPF PUSH '#' expr PUSH '[' expr ']' PUSH expr '[' expr ']' DIRECT PUSH expr '[' expr ']' EXTENDED PUSH expr DIRECT PUSH expr EXTENDED PUSHA CPU196 PUSHF RET RST SCALL expr SETC SHL expr ',' '#' expr SHL expr ',' expr SHLB expr ',' '#' expr SHLB expr ',' expr SHLL expr ',' '#' expr SHLL expr ',' expr SHR expr ',' '#' expr SHR expr ',' expr SHRA expr ',' '#' expr SHRA expr ',' expr - 10 - Opcode Syntax Selection Criteria SHRAB expr ',' '#' expr SHRAB expr ',' expr SHRAL expr ',' '#' expr SHRAL expr ',' expr SHRB expr ',' '#' expr SHRB expr ',' expr SHRL expr ',' '#' expr SHRL expr ',' expr SJMP expr SKIP expr ST expr ',' '[' expr ']' ST expr ',' expr '[' expr ']' DIRECT ST expr ',' expr '[' expr ']' EXTENDED ST expr ',' expr DIRECT ST expr ',' expr EXTENDED STB expr ',' '[' expr ']' STB expr ',' expr '[' expr ']' DIRECT STB expr ',' expr '[' expr ']' EXTENDED STB expr ',' expr DIRECT STB expr ',' expr EXTENDED SUB expr ',' '#' expr SUB expr ',' '[' expr ']' SUB expr ',' expr ',' '#' expr SUB expr ',' expr ',' '[' expr ']' SUB expr ',' expr ',' expr '[' expr ']' DIRECT SUB expr ',' expr ',' expr '[' expr ']' EXTENDED SUB expr ',' expr ',' expr DIRECT SUB expr ',' expr ',' expr EXTENDED SUB expr ',' expr '[' expr ']' DIRECT SUB expr ',' expr '[' expr ']' EXTENDED SUB expr ',' expr DIRECT SUB expr ',' expr EXTENDED SUBB expr ',' '#' expr SUBB expr ',' '[' expr ']' SUBB expr ',' expr ',' '#' expr SUBB expr ',' expr ',' '[' expr ']' SUBB expr ',' expr ',' expr '[' expr ']' DIRECT - 11 - Opcode Syntax Selection Criteria SUBB expr ',' expr ',' expr '[' expr ']' EXTENDED SUBB expr ',' expr ',' expr DIRECT SUBB expr ',' expr ',' expr EXTENDED SUBB expr ',' expr '[' expr ']' DIRECT SUBB expr ',' expr '[' expr ']' EXTENDED SUBB expr ',' expr DIRECT SUBB expr ',' expr EXTENDED SUBC expr ',' '#' expr SUBC expr ',' '[' expr ']' SUBC expr ',' expr '[' expr ']' DIRECT SUBC expr ',' expr '[' expr ']' EXTENDED SUBC expr ',' expr DIRECT SUBC expr ',' expr EXTENDED SUBCB expr ',' '#' expr SUBCB expr ',' '[' expr ']' SUBCB expr ',' expr '[' expr ']' DIRECT SUBCB expr ',' expr '[' expr ']' EXTENDED SUBCB expr ',' expr DIRECT SUBCB expr ',' expr EXTENDED XOR expr ',' '#' expr XOR expr ',' '[' expr ']' XOR expr ',' expr '[' expr ']' DIRECT XOR expr ',' expr '[' expr ']' EXTENDED XOR expr ',' expr DIRECT XOR expr ',' expr EXTENDED XORB expr ',' '#' expr XORB expr ',' '[' expr ']' XORB expr ',' expr '[' expr ']' DIRECT XORB expr ',' expr '[' expr ']' EXTENDED XORB expr ',' expr DIRECT XORB expr ',' expr EXTENDED A.2.2 Selection_Criteria_Keywords DIRECT The instruction will be generated with a short form if the last operand will fit in one byte, and is defined when the instruction is processed in the first pass. EXTENDED The instruction can be generated with a long form. CPU196 The instruction is implemented only in the 80c196. - 12 - A.2.3 Apostrophes The apostrophes in the syntax field are a notation used for the parser generator and are not put in the assembler source statement. A.3 Notes A.3.1 Data_Alignment In the second pass, data address are checked for alignment. If the operand field is not divisible by 2 for word references, or by 4 for long word references, the error message "expression fails validity test" occurs. A.3.2 Generic_Jumps The assembler requires that the length of an instruction be able to be determined at the first pass, so generalized generic jumps could not be implemented. A.3.3 Reserved_Symbols A.3.3.1 Standard_Reserved_Symbols AND DEFINED EQ GE GT HIGH LE LOW LT MOD NE NOT OR SHL SHR XOR and defined eq ge gt high le low lt mod ne not or shl shr xor CONTENTS A. Appendix for as8096 Frankenstein Assembler.......... 1 A.1 Pseudo Operations.............................. 1 A.2 Instructions................................... 2 A.3 Notes.......................................... 12 - i -